﻿<?php get_header(); do_action('wp_enqueue_script');?>				
				
					<img style="border:none;float:left;margin-right:50px" src="<?php echo get_template_directory_uri(); ?>/images/main_pic.png" />
					
					<?php 
						$args = array(								
							meta_query => array(
						        array(
						            'key' => 'keycontent',
						            'value' => 'about-home',
						            'compare' => '='
						        )
					        )
						);
						query_posts($args);						
					?>
					<?php if(have_posts()):the_post();?>
						<span class="main_title"><?php the_title();?></span><br /><br />
						<span><?php echo get_the_content();?></span>
					<?php endif; ?>
					<div class="cleaner" style="height:30px;"></div>
					<!-- 
					<div class="main_title" style="margin-bottom:30px;">Hình ảnh hoạt động</div>
					<a href="#"><img class="active_image" src="<?php echo get_template_directory_uri(); ?>/images/image.jpg" /></a>
					<a href="#"><img class="active_image" src="<?php echo get_template_directory_uri(); ?>/images/image.jpg" /></a>
					<a href="#"><img class="active_image" src="<?php echo get_template_directory_uri(); ?>/images/image.jpg" /></a>
					<a href="#"><img class="active_image" src="<?php echo get_template_directory_uri(); ?>/images/image.jpg" /></a>
					<div class="cleaner"></div>
					 -->
					 
					<div class="main_title" style="margin-top:30px;margin-bottom:30px;">Tin tức & sự kiện</div>
					<?php 
					 wp_reset_query();
					 $catnewsid=get_cat_ID('news');
					 $catgalleryid=get_cat_ID('gallery');
					 $catcourseid=get_cat_ID('course');
					 $catlibraryeid=get_cat_ID('library');
					 $args = array(
							'category__in'=>array($catnewsid,$catgalleryid,$catcourseid,$catlibraryeid),
					 		'showposts'=>6
						);						
					 query_posts($args);
					 $i=0;						
					?>
					<?php while(have_posts()):the_post();						
						$i++;
						$cat=get_the_category();
						if($i==1){
					?>
					<div id="news_left">
						<div class="image_wrapper indexImage" style="float:left;margin-right:30px;">
							<a href="<?php echo the_permalink()?>">
							<?php echo the_post_thumbnail('medium',array('style'=>'width:204px;','title'=>get_the_title(),'alt'=>get_the_title()) );?>
							
							</a>
						</div>
						<a href="<?php echo the_permalink()?>"><span style="font-weight:bold;font-size:16px;"><?php the_title();?></span></a><br /><br />
						<span><?php if($cat[0]->cat_ID!=$catgalleryid)echo wp_trim_words(get_the_content()); ?></span>
						<div class="cleaner"></div>
					</div>
					
					<?php }else{?>
						<?php if($i==2):?>
							<div id="news_right">
						<?php endif?>
								<div class="news_item"><a href="<?php echo the_permalink()?>"><?php the_title();?></a></div>
					<?php }?>
					<?php endwhile; ?>					
					</div>
							
<?php get_footer(); ?>